package com.qch.edu.ad.remote;

import com.qch.edu.ad.dto.PromotionSpaceDTO;
import com.qch.edu.ad.entity.PromotionSpace;
import com.qch.edu.ad.service.IPromotionSpaceService;
import com.qch.edu.util.ConverUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Author qch
 * @Date 2021/9/3
 */
@RestController
@RequestMapping("/ad")
public class AdRemoteServiceImpl implements AdRemoteService{
    @Autowired
    private IPromotionSpaceService promotionSpaceService;
    @GetMapping("/space/getAllSpaces")
    public List<PromotionSpaceDTO> getAllSpace() {
        List<PromotionSpace> list = promotionSpaceService.list();
        return ConverUtil.convertList(list,PromotionSpaceDTO.class);
    }
}
